package com.millstein.educms.controller;

import com.millstein.commonutils.Result;
import com.millstein.educms.entity.CrmBanner;
import com.millstein.educms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/educms/bannerfront")
public class BannerFrontController {

    @Autowired
    private CrmBannerService crmBannerService;

    /**
     * 获取所有轮播图图片
     * @return
     */
    @GetMapping
    public Result getAllBanner() {
        List<CrmBanner> list = crmBannerService.selectAllBanner();
        return Result.ok().data("list", list);
    }
}
